import store from '@/store/index'

export default {
  imgerr: {
    inserted: (dom, binding) => {
      dom.src = dom.src || binding.value
      dom.onerror = () => {
        dom.src = binding.value
      }
    }
  },
  permission: {
    // 会在指令作用的元素插入到页面完成以后触发
    inserted(el, binding) {
      // el 指令作用的元素的dom对象
      console.log(el)
      const points = store.state.user.userInfo?.roles?.points || []
      if (!points.includes(binding.value)) {
        el.remove()
      }
    }

  }
}

